import { Injectable } from '@angular/core';
import { Resolve, ActivatedRouteSnapshot } from '@angular/router';
import { ListResult } from 'app/modules/base/api-base';
import { Personnel, PersonnelService } from './personnel.service';

@Injectable({
	providedIn: 'root',
})
export class ListService implements Resolve<ListResult<Personnel>> {
	constructor(private personnelService: PersonnelService) {}
	async resolve(route: ActivatedRouteSnapshot) {
		return this.personnelService.list({ ...route.queryParams });
	}
}
